home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 34.zip / BS1 part 34 / Codex ass dev system v1.10.adf / include / devices / trackdisk.i < prev   
Text File  |  1988-09-19  |  4KB  |  137 lines

  1. ********************************************************************
  2. *               Commodore-Amiga, Inc.                              *
  3. *               trackdisk.i                                        *
  4. ********************************************************************
  5. ********************************************************************
  6. *
  7. * trackdisk.i
  8. *
  9. * Source Control
  10. * ------ -------
  11. * $Header: trackdisk.i,v 27.2 85/07/12 23:16:27 neil Exp $
  12. *
  13. * $Locker:  $
  14. *
  15. *********************************************************************
  16.  
  17.    IFND  DEVICES_TRACKDISK_I
  18. DEVICES_TRACKDISK_I  SET   1
  19.  
  20.    IFND  EXEC_IO_I
  21.    INCLUDE  "exec/io.i"
  22.    ENDC  !EXEC_IO_I
  23.  
  24. *--------------------------------------------------------------------
  25. *
  26. * Physical drive constants
  27. *
  28. *--------------------------------------------------------------------
  29.  
  30.  
  31. NUMCYLS     EQU   80          ; normal # of cylinders
  32. MAXCYLS     EQU   NUMCYLS+20  ; max # of cyls to look for
  33. *                             ;  during a calibrate
  34. NUMSECS     EQU   11
  35. NUMHEADS    EQU   2
  36. MAXRETRY    EQU   10
  37. NUMTRACKS   EQU   NUMCYLS*NUMHEADS
  38. NUMUNITS    EQU   4
  39.  
  40. *--------------------------------------------------------------------
  41. *
  42. * Useful constants
  43. *
  44. *--------------------------------------------------------------------
  45.  
  46.  
  47. *-- sizes before mfm encoding
  48. TD_SECTOR   EQU   512
  49. TD_SECSHIFT EQU   9        ; log TD_SECTOR
  50. *                          ;    2
  51.  
  52.  
  53. *--------------------------------------------------------------------
  54. *
  55. * Driver Specific Commands
  56. *
  57. *--------------------------------------------------------------------
  58.  
  59. *-- TD_NAME is a generic macro to get the name of the driver.  This
  60. *-- way if the name is ever changed you will pick up the change
  61. *-- automatically.
  62. *--
  63. *-- Normal usage would be:
  64. *--
  65. *-- internalName: TD_NAME
  66. *--
  67.  
  68. TD_NAME: MACRO
  69.       DC.B  'trackdisk.device',0
  70.       DS.W  0
  71.       ENDM
  72.  
  73.    BITDEF   TD,EXTCOM,15
  74.  
  75.    DEVINIT
  76.    DEVCMD   TD_MOTOR          ; control the disk's motor
  77.    DEVCMD   TD_SEEK           ; explicit seek (for testing)
  78.    DEVCMD   TD_FORMAT         ; format disk
  79.    DEVCMD   TD_REMOVE         ; notify when disk changes
  80.    DEVCMD   TD_CHANGENUM      ; number of disk changes
  81.    DEVCMD   TD_CHANGESTATE    ; is there a disk in the drive?
  82.    DEVCMD   TD_PROTSTATUS     ; is the disk write protected?
  83.  
  84. TD_LASTCOMM EQU   TD_PROTSTATUS
  85.  
  86. *
  87. *
  88. * The disk driver has an "extended command" facility.  These commands
  89. * take a superset of the normal IO Request block.
  90. *
  91. ETD_WRITE   EQU   (CMD_WRITE!TDF_EXTCOM)
  92. ETD_READ    EQU   (CMD_READ!TDF_EXTCOM)
  93. ETD_MOTOR   EQU   (TD_MOTOR!TDF_EXTCOM)
  94. ETD_SEEK    EQU   (TD_SEEK!TDF_EXTCOM)
  95. ETD_FORMAT  EQU   (TD_FORMAT!TDF_EXTCOM)
  96. ETD_UPDATE  EQU   (CMD_UPDATE!TDF_EXTCOM)
  97. ETD_CLEAR   EQU   (CMD_CLEAR!TDF_EXTCOM)
  98.  
  99.  
  100. *
  101. * extended IO has a larger than normal io request block.
  102. *
  103.  
  104.  STRUCTURE IOEXTTD,IOSTD_SIZE
  105.    ULONG IOTD_COUNT           ; removal/insertion count
  106.    ULONG IOTD_SECLABEL        ; sector label data region
  107.    LABEL IOTD_SIZE
  108.  
  109. * labels are TD_LABELSIZE bytes per sector
  110.  
  111. TD_LABELSIZE         EQU   16
  112.  
  113. *--------------------------------------------------------------------
  114. *
  115. * Driver error defines
  116. *
  117. *--------------------------------------------------------------------
  118.  
  119. TDERR_NotSpecified   EQU   20
  120. TDERR_NoSecHdr       EQU   21
  121. TDERR_BadSecPreamble EQU   22
  122. TDERR_BadSecID       EQU   23
  123. TDERR_BadHdrSum      EQU   24
  124. TDERR_BadSecSum      EQU   25
  125. TDERR_TooFewSecs     EQU   26
  126. TDERR_BadSecHdr      EQU   27
  127. TDERR_WriteProt      EQU   28
  128. TDERR_DiskChanged    EQU   29
  129. TDERR_SeekError      EQU   30
  130. TDERR_NoMem          EQU   31
  131. TDERR_BadUnitNum     EQU   32
  132. TDERR_BadDriveType   EQU   33
  133. TDERR_DriveInUse     EQU   34
  134.  
  135.    ENDC  DEVICE_TRACKDISK_I
  136.